<template>
  <div id="app" class="g-container">
    <div class="g-view-container">
      <keep-alive>
        <router-view></router-view>
      </keep-alive>
    </div>
    <div class="g-footer-container" v-if="show" >
      <c-tabbar />
    </div>
  </div>
</template>

<script>

import CTabbar from 'components/tabbar'
export default {
  name: 'App',
  components: {
    CTabbar
  },
  data () {
    return {
      show: true
    }
  },
  watch: {
    '$route': 'changeShow'
  },
  methods: {
    changeShow () {
      if (this.$route.path === '/login' || this.$route.path === '/register') {
        this.show = false
      } else {
        this.show = true
      }
      console.log(this.show)
      console.log(this.$route.path)
    }
  }
}
</script>
